<%@ include file="/taglibs.jsp"%>
<jsp:directive.page import="com.winterwar.base.Registration"/>
<jsp:directive.page import="java.text.NumberFormat"/>

<%
	Registration reg = (Registration) request.getAttribute("registration");
	
	double total = reg.getCost() - reg.getCostOffset() - reg.getPaid();
	
	NumberFormat nf = NumberFormat.getCurrencyInstance();
%>
<title>Winter War - Registration History for ${con.conName }</title>

<h2>Registration Details for ${con.conName }</h2>
<center>
<table>
	<tr>
		<th>Registrant Name</th> <td colspan="3">${registration.user.firstName } ${registration.user.lastName }</td>
	</tr><tr>
		<th>Address</th> <td colspan="3">${registration.user.address1 }</td>
	</tr><tr>
		<th>City/State/Postal Code</th> <td colspan="3">${registration.user.city }, ${registration.user.state } ${registration.user.zipCode }</td>
	</tr><tr>
		<th>Contact Info</th> <td colspan="3">${registration.user.email } ${registration.user.phoneNumber }</td>
	</tr>
	<tr><td colspan="4"><hr></td></tr>
	<tr>
		<th><bean:message key="registration.type"/>: </th>
		<c:choose>
			<c:when test="${registration.type == '1' }">
				<td>Single Day</td>
				<th><bean:message key="registration.dayRegistered"/>: </th>
				<td>
					<c:choose>
						<c:when test="${registration.dayRegistered == '1' }">Friday</c:when>
						<c:when test="${registration.dayRegistered == '2' }">Saturday</c:when>
						<c:when test="${registration.dayRegistered == '3' }">Sunday</c:when>
					</c:choose>
				</td>
			</c:when>
			<c:when test="${registration.type == 2 }">
				<td colspan="3">Weekend</td>
			</c:when>
			<c:when test="${registration.type == 3 }">
				<td colspan="3">ASL Weekend</td>
			</c:when>
		</c:choose>
	</tr>
	<tr><th>Events Selected:</th></tr>
	<c:forEach var="regEvent" items="${registration.events}">
		<tr>
			<td colspan="4">${regEvent.event.slotName } : ${regEvent.event.eventName}</td>
		</tr>
	</c:forEach>
	<tr><td colspan="4"><hr></td></tr>
	<tr>
		<th>Amount Owed:</th>
		<td colspan="3"><%=nf.format(total) %></td>
	</tr>
</table>
</center>